POV-Ray : Newsgroups : povray.general : cos & sin functions : Re: cos & sin functions Server Time
2 Aug 2024 00:12:10 EDT (-0400)
  Re: cos & sin functions  
From: B  Gimeno
Date: 19 Feb 2005 16:03:42
Message: <4217a9ae$1@news.povray.org>
Hi,
take in count that pov rotates objects en degrees, but count sin and cos
functions in radians, then
instead
object {XX rotate x*cos(30),
use a conversion inside de cos function
object {XX rotate x*cos(radians(30))}
--
B Gimeno
estoeslarealidad
http://usuarios.lycos.es/game2413
----------------------------------------------------------------------------
light_source {0,1}#local C=cylinder{x*-2,x*2,.9}difference{box{-1,1}object{C
pigment {red 1}}object{C rotate y*90 pigment{green 1}}object{C rotate z*90
pigment{blue 1}} pigment{rgb 3}rotate 45 translate z*4}


news:web.4217a68c1eb30463d977fb9c0@news.povray.org...
> i'm working on a trebuchet, that i should have animated. The problem is,
> that i gotta have a piece rotating around a centerpoint in a circle. I'm
> going to use cos and sin functions to get the x and y coordinates like
> this:
> cos(A)*r=x
> sin(A)*r=y
>
> A=angle r=radius
> The problem is, that when i use it, either the POV-Ray, or my calculator
are
> calculating wrong - most likely POV-Ray. my .pov code looks like this:
> ----------------------------------
> #include "woods.inc"
> declare beam = box{<0,0,0><1,1,1>
> texture{T_Wood20}
> }
> #declare ANGLE = 1; /*change this to 1,2,3 etc.*/
> object{beam scale<1.9,35.56,1.27> translate<0,43,2.54> translate
> x*cos(ANGLE)*-22.86 translate y*sin(ANGLE)*-22.86}
> --------------------------------------------
> For me, it just looks like the beam is jumping around, rather than
following
> a circular pattern, which it should do.
> Hope you can help me.
> -Tjeiken
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.